// 动效
import { ecs } from '../framework/assets/libs/ecs/ECS';
import { EffectBombComponent, EffectCrushComponent } from "./utilsComponent";

@ecs.register('EffectEntity')
export class EffectEntity extends ecs.Entity {

    protected init() {
    }

    // 消除动效
    addCrush(posX, posY) {
        const comp = this.add(EffectCrushComponent);
        comp.posX = posX;
        comp.posY = posY;
    }

    // 爆炸
    addBomb(posX: number, posY: number, isLine?: boolean) {
        const comp = this.add(EffectBombComponent);
        comp.posX = posX;
        comp.posY = posY;
        comp.isLine = !!isLine;
    }
}
